﻿using System;
using System.Collections.Generic;
using System.Text;
using Ch.Admin.Bfs.Sms.Sdmx.Extension.CodeBook.Configuration;

namespace Ch.Admin.Bfs.Sms.Sdmx.Extension.CodeBook.Meta
{
    public class MetaProviderFactory : IMetaProviderFactory
    {
        #region IMetaProviderFactory Members

        public IMetaProvider GetMetaProvider(TableOfContents moduleType, string language, string metaFullId, BookConfiguration cfg)
        {
            IMetaProvider ip = null;
            switch (moduleType)
            {
                case TableOfContents.Book:
                    ip = new BookProvider(language, metaFullId, cfg);
                    break;
                case TableOfContents.Overview:
                    ip = new OverviewProvider(language, metaFullId, cfg);
                    break;
                case TableOfContents.Catalog:
                    ip = new CatVarProvider(language, metaFullId, cfg);
                    break;
                case TableOfContents.Questionnaires:
                    ip = new QuestionnaireProvider(language, metaFullId, cfg);
                    break;
                case TableOfContents.DataTables:
                    break;
                case TableOfContents.Codelists:
                    ip = new CodelistProvider(language, metaFullId, cfg);
                    break;
                case TableOfContents.Correspondences:
                    break;
                case TableOfContents.Hierarchies:
                    ip = new HierarchyCodelistProvider(language, metaFullId, cfg);
                    break;
                default:
                    ip = null;
                    break;
            }
            return ip;
        }

        public HierarchyNode ReferedCodelistModuleContent()
        {
            return BaseMetaProvider.ReferedCodelistModuleContent();
        }

        public void ClearReferedCodelist()
        {
            BaseMetaProvider.CodelistClear();
        }

        #endregion

        #region Activity

        public List<string> GetActivityList(string lg)
        {
            List<string> Activities = null;

            return Activities;
        }

        public void ClearMetaCache()
        {
            BaseMetaProvider.sm = SdmxMl.Manager.ReferenceManager.GetSmContainerImage();
        }

        #endregion
    }
}
